﻿<UserControl x:Class="BookManager.Views.Controls.BookCover"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Height="120" Width="90" Padding="5,3" VerticalAlignment="Stretch">

    <Grid Name="MainLayout">
        <Border Name="brdBookCover" BorderBrush="LightGray" BorderThickness="1">
            <Grid Name="grdBookCover">
                <Image Name="imgBookCover" />
                <Button Name="btnOpenBookDetails" Grid.Row="1" Margin="2" Height="23" Width="23"
                        HorizontalAlignment="Right" VerticalAlignment="Bottom" Content=".." 
                        Command="{Binding DataContext.OpenBookDetailsCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding }">
                    <Button.ToolTip>
                        <TextBlock Text="{Binding Title, StringFormat='Open {0}'}" />
                    </Button.ToolTip>
                </Button>
            </Grid>
        </Border>
    </Grid>
</UserControl>
